'\" e
'\"! eqn | mmdoc
'\"macro stdmacro
.ds Vn Version 1.2
.ds Dt 6 March 1997
.ds Re Release 1.2.0
.ds Dp May 02 11:53
.ds Dm 37 scaleimag
.ds Xs 38480 7 scaleimage.gl
.TH GLUSCALEIMAGE 3G
.SH NAME
.B "gluScaleImage
\- scale an image to an arbitrary size

.SH C SPECIFICATION
GLint \f3gluScaleImage\fP(
GLenum \fIformat\fP,
.nf
.ta \w'\f3GLint \fPgluScaleImage( 'u
	GLsizei \fIwIn\fP,
	GLsizei \fIhIn\fP,
	GLenum \fItypeIn\fP,
	const void \fI*dataIn\fP,
	GLsizei \fIwOut\fP,
	GLsizei \fIhOut\fP,
	GLenum \fItypeOut\fP,
	GLvoid* \fIdataOut\fP )
.fi

.EQ
delim $$
.EN
.SH PARAMETERS
.TP \w'\fItypeOut\fP\ \ 'u 
\f2format\fP
Specifies the  of the pixel data.
The following symbolic values are valid:
\%\f3GL_COLOR_INDEX\fP,
\%\f3GL_STENCIL_INDEX\fP,
\%\f3GL_DEPTH_COMPONENT\fP,
\%\f3GL_RED\fP,
\%\f3GL_GREEN\fP,
\%\f3GL_BLUE\fP,
\%\f3GL_ALPHA\fP,
\%\f3GL_RGB\fP,
\%\f3GL_RGBA\fP,
\%\f3GL_BGR\fP,
\%\f3GL_BGRA\fP,
\%\f3GL_LUMINANCE\fP, and
\%\f3GL_LUMINANCE_ALPHA\fP.
.TP
\f2wIn\fP, \f2hIn\fP
Specify in pixels the width and height, respectively, of the source image.
.TP
\f2typeIn\fP
Specifies the data type for \f2dataIn\fP. Must be one of
\%\f3GL_UNSIGNED_BYTE\fP,
\%\f3GL_BYTE\fP,
\%\f3GL_BITMAP\fP,
\%\f3GL_UNSIGNED_SHORT\fP,
\%\f3GL_SHORT\fP,
\%\f3GL_UNSIGNED_INT\fP,
\%\f3GL_INT\fP, 
\%\f3GL_FLOAT\fP, 
\%\f3GL_UNSIGNED_BYTE_3_3_2\fP,
\%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_6_5\fP,
\%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP,
\%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP,
\%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP,
\%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP,
\%\f3GL_UNSIGNED_INT_10_10_10_2\fP, and
\%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP.
.TP
\f2dataIn\fP
Specifies a pointer to the source image.
.TP
\f2wOut\fP, \f2hOut\fP
Specify the width and height, respectively, in pixels of the destination image.
.TP
\f2typeOut\fP
Specifies the data type for \f2dataOut\fP. Must be one of
\%\f3GL_UNSIGNED_BYTE\fP,
\%\f3GL_BYTE\fP,
\%\f3GL_BITMAP\fP,
\%\f3GL_UNSIGNED_SHORT\fP,
\%\f3GL_SHORT\fP,
\%\f3GL_UNSIGNED_INT\fP,
\%\f3GL_INT\fP, 
\%\f3GL_FLOAT\fP,
\%\f3GL_UNSIGNED_BYTE_3_3_2\fP,
\%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_6_5\fP,
\%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP,
\%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP,
\%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP,
\%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP,
\%\f3GL_UNSIGNED_INT_10_10_10_2\fP, or
\%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP.
.TP
\f2dataOut\fP
Specifies a pointer to the destination image.
.SH DESCRIPTION
\%\f3gluScaleImage\fP scales a pixel image using the appropriate pixel store modes to 
unpack data from the source image and pack data into the destination image.
.P
When shrinking an image, \%\f3gluScaleImage\fP uses a box filter to sample the source image
and create pixels for the destination image.  When magnifying an image,
the pixels from the source image are linearly interpolated to create the
destination image.
.P
A return value of zero indicates success, otherwise a GLU error code is returned (see \%\f3gluErrorString\fP).
.P
See the \f3glReadPixels\fP reference page for a description of
the acceptable values for the \f2format\fP, \f2typeIn\fP, and \f2typeOut\fP parameters.
.SH NOTES
Formats \%\f3GL_BGR\fP, and \%\f3GL_BGRA\fP, and types 
\%\f3GL_UNSIGNED_BYTE_3_3_2\fP,
\%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_6_5\fP,
\%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP,
\%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP,
\%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP,
\%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP,
\%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8\fP,
\%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP,
\%\f3GL_UNSIGNED_INT_10_10_10_2\fP, and
\%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP are only available if the GL version 
is 1.2 or greater.
.SH ERRORS
\%\f3GLU_INVALID_VALUE\fP is returned if \f2wIn\fP, \f2hIn\fP, \f2wOut\fP, or \f2hOut\fP
is negative.
.P
\%\f3GLU_INVALID_ENUM\fP is returned if \f2format\fP, \f2typeIn\fP, or \f2typeOut\fP is not
legal.
.P
\%\f3GLU_INVALID_OPERATION\fP is returned if \f2typeIn\fP or \f2typeOut\fP is 
\%\f3GL_UNSIGNED_BYTE_3_3_2\fP or \%\f3GL_UNSIGNED_BYTE_2_3_3_REV\fP 
and \f2format\fP is not \%\f3GL_RGB\fP.
.P
\%\f3GLU_INVALID_OPERATION\fP is returned if \f2typeIn\fP or \f2typeOut\fP is 
\%\f3GL_UNSIGNED_SHORT_5_6_5\fP or \%\f3GL_UNSIGNED_SHORT_5_6_5_REV\fP 
and \f2format\fP is not \%\f3GL_RGB\fP.
.P
\%\f3GLU_INVALID_OPERATION\fP is returned if \f2typeIn\fP or \f2typeOut\fP is
\%\f3GL_UNSIGNED_SHORT_4_4_4_4\fP or \%\f3GL_UNSIGNED_SHORT_4_4_4_4_REV\fP 
and \f2format\fP is neither \%\f3GL_RGBA\fP nor \%\f3GL_BGRA\fP.
.P
\%\f3GLU_INVALID_OPERATION\fP is returned if \f2typeIn\fP or \f2typeOut\fP is
\%\f3GL_UNSIGNED_SHORT_5_5_5_1\fP or \%\f3GL_UNSIGNED_SHORT_1_5_5_5_REV\fP
and \f2format\fP is neither \%\f3GL_RGBA\fP nor \%\f3GL_BGRA\fP.
.P
\%\f3GLU_INVALID_OPERATION\fP is returned if \f2typeIn\fP or \f2typeOut\fP is
\%\f3GL_UNSIGNED_INT_8_8_8_8\fP or \%\f3GL_UNSIGNED_INT_8_8_8_8_REV\fP 
and \f2format\fP is neither \%\f3GL_RGBA\fP nor \%\f3GL_BGRA\fP.
.P
\%\f3GLU_INVALID_OPERATION\fP is returned if \f2typeIn\fP or \f2typeOut\fP is
\%\f3GL_UNSIGNED_INT_10_10_10_2\fP or \%\f3GL_UNSIGNED_INT_2_10_10_10_REV\fP
and \f2format\fP is neither \%\f3GL_RGBA\fP nor \%\f3GL_BGRA\fP.
.SH SEE ALSO
\f3glDrawPixels(3G)\fP, \f3glReadPixels(3G)\fP, \%\f3gluBuild1DMipmaps(3G)\fP, \%\f3gluBuild2DMipmaps(3G)\fP, 
\%\f3gluBuild3DMipmaps(3G)\fP, 
.BR
\%\f3gluErrorString(3G)\fP

